package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLString;
import HLLib.io.HLPackage;

public class HLClassPackage extends HLLibClass {
    public HLClassPackage(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLPackage();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLPackage) self).Load((HLString)args.GetObject(0));
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                ((HLPackage) self).GetLength();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLPackage) self).GetLength());
            }
            break;
        }
        case 2: {
            ((HLPackage) self).Save((HLString)args.GetObject(0));
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                ((HLPackage) self).GetAllImage();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLPackage) self).GetAllImage());
            }
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                ((HLPackage) self).GetData(args.GetInt(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLPackage) self).GetData(args.GetInt(0)));
            }
            break;
        }
        case 5: {
            if (resultOwnerObject == null) {
                ((HLPackage) self).GetFile(args.GetInt(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLPackage) self).GetFile(args.GetInt(0)));
            }
            break;
        }
        case 6: {
            if (resultOwnerObject == null) {
                ((HLPackage) self).GetImage(args.GetInt(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLPackage) self).GetImage(args.GetInt(0)));
            }
            break;
        }
        }
    }
}
